load("//rs/tests:system_tests.bzl", "system_test", "system_test_nns")

package(default_visibility = ["//rs:system-tests-pkg"])

LEDGER_CANISTER_RUNTIME_DEPS = [
    # Keep sorted.
    "//rs/ledger_suite/icrc1/ledger:ledger_canister",
]

system_test(
    name = "icrc1_agent_test",
    env = {
        "LEDGER_WASM_PATH": "$(rootpath //rs/ledger_suite/icrc1/ledger:ledger_canister)",
    },
    runtime_deps =
        LEDGER_CANISTER_RUNTIME_DEPS,
    deps = [
        "//packages/icrc-ledger-agent:icrc_ledger_agent",
        "//packages/icrc-ledger-types:icrc_ledger_types",
        "//rs/crypto/tree_hash",
        "//rs/ledger_suite/common/ledger_core",
        "//rs/ledger_suite/icrc1/ledger",
        "//rs/nns/test_utils",
        "//rs/registry/subnet_type",
        "//rs/rust_canisters/canister_test",
        "//rs/rust_canisters/dfn_candid",
        "//rs/rust_canisters/on_wire",
        "//rs/tests/driver:ic-system-test-driver",
        "@crate_index//:anyhow",
        "@crate_index//:assert_matches",
        "@crate_index//:candid",
        "@crate_index//:leb128",
        "@crate_index//:serde_cbor",
    ],
)

system_test_nns(
    name = "transaction_ledger_correctness_test",
    compile_data = [
        "transaction_ledger_correctness.wasm",
    ],
    proc_macro_deps = [
        "@crate_index//:async-recursion",
    ],
    deps = [
        "//rs/canister_client/sender",
        "//rs/ledger_suite/common/ledger_core",
        "//rs/ledger_suite/icp:icp_ledger",
        "//rs/ledger_suite/icrc1/ledger",
        "//rs/nns/constants",
        "//rs/nns/test_utils",
        "//rs/registry/subnet_type",
        "//rs/rust_canisters/canister_test",
        "//rs/rust_canisters/dfn_candid",
        "//rs/rust_canisters/dfn_protobuf",
        "//rs/tests/driver:ic-system-test-driver",
        "//rs/types/base_types",
        "//rs/types/types",
        "@crate_index//:anyhow",
        "@crate_index//:ic-agent",
        "@crate_index//:ic-utils",
        "@crate_index//:quickcheck",
        "@crate_index//:rand",
        "@crate_index//:rand_chacha",
        "@crate_index//:slog",
        "@crate_index//:tokio",
    ],
)
